<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <link href="/Public/Admin/css/form.css" rel="stylesheet" /> 
    <script src="/Public/static/layer/layer.js"></script>
    <!--文件上传-->
    <script type="text/javascript" src="/Public/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        body{font-size: 14px}

    </style>
</block>
<block name="content"> 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <p class="nav-title">
                    <a class="newsAdd_btn" title="返回" href="javascript:history.go(-1)"><img src="/Public/Admin/images/back.png" /></a>
                    <a href="{:U('Flow/lists')}"><span>我的流程</span></a> &nbsp;> &nbsp;
                    <a href="{:U('Flow/index')}"><span>选择流程</span></a> &nbsp;> &nbsp;流程表单
                </p>
                <form>
                    <div class="flowInfoWrap">
                        <div class="flowInfo">
                            <span class="txt1">NO.{$info.run_id|default=1} <if condition="$info[run_name] neq null">{$info.run_name}<else/>{$flow_id|getFlowName}</if></span>
                            <label class="txt2">（第{$currPrcs}步：{$stepName}）</label>
                            <div class="btnBox">
                                <a class="pointer showChart" data-id="{$flow_id}" data-prcs="{$currPrcs}"><img src="/Public/Admin/images/flow9.png" />流程图</a>
                                <a href="javascript:;"><img src="/Public/Admin/images/flow10.png" />委托</a>
                                <a href="javascript:;"><img src="/Public/Admin/images/flow11.png" />打印</a>
                            </div>
                        </div>
                    </div>
                    <div class="cont">
                        <div class="form-cont form">
                            {$form.print_model}
                        </div>
                        <div class="up" style="">
                            <div class="line width1">公共附件区</div>
                            <!--是否允许上传附件或是否允许修改附件-->
                            <if condition="$currPrcs eq 1 and $flowDoc eq 1">
                                <div class="line pointer width2">
                                    <a id="upload"><img src="/Public/Admin/images/add.png" /> 添加附件</a>
                                </div>
                            </if>
                            <if condition="$currPrcs neq 1 and $editDoc eq 1">
                                <div class="line pointer width2">
                                    <a id="upload"><img src="/Public/Admin/images/add.png" /> 修改附件</a>
                                </div>
                            </if>
                            <div class="line filename-cont uploadCon" style="margin:1% 0 0 24%;width:60%;line-height: 35px">
                                <notempty name="uploads[0].name">
                                    <foreach name="uploads" item="row" key="key">
                                        <span style="display:block;height:30px;line-height: 30px">
                                            <a href="{$row.upload}" download="{$row.name}">{$key+1}. {$row.name}</a>
                                            <if condition="$currPrcs neq 1 and $editDoc eq 1">
                                                <img src="/Public/Index/img/close.png" class="pointer delfile" data-fileurl="{$row.upload}"/>
                                            </if>
                                        </span>
                                    </foreach>
                                </notempty>
                            </div>

                            <input type="file" id="inputImage" name='imgfile' style="display:none">
                            <input type="hidden" id="filename" name="uploads" value="{$uploads[0].uploadsName}">
                            <input type="hidden" id="fileurl" name="uploads_url" value="{$uploads[0].uploadsUrl}">
                            <if condition="$currPrcs eq 1">
                                <input type="hidden" name="url" value="{:U('delFile')}">
                                <else />
                                <input type="hidden" name="url" value="{:U('delFile',array('table'=>'flow_run','field'=>'run_id','id'=>$run_id))}">
                            </if>
                        </div>
                        <div class="clear"></div>
                        <!--会签意见区-->
                        <if condition="$prcs neq 1 and $feedback neq 1">
                            <div class="feedback up"  style="">
                                <div class="line width1">会签意见区</div>
                                <textarea class="width2" name="feedback" style="height:200px;margin-top:8px;margin-bottom:2em;margin-left:20px;border-color:#efefef;padding-top:10px"></textarea>
                            </div>
                        </if>
                        <input type="hidden" name="form_id" value="{$form_id}">
                        <input type="hidden" name="run_id" value="{$run_id}">
                        <input type="hidden" name="prcs_id" value="{$prcs}">
                        <input type="hidden" name="flow_id" value="{$flow_id}">
                        <input type='hidden' name='currPrcs' value="{$currPrcs}">
                        <input type="hidden" name="isEdit" value="{$info.isEdit}">
                        <input type="hidden" id="flow_id" value="{$info.flow_id|default=0}">
                        <!--流程查询中管理员修改参数-->
                        <input type="hidden" name="flowType" value="{$flowType}">
                        <!--当前实际流程标记号-->
                        <input type="hidden" name="prcsNum" value="{$prcsNum}">

                        <div class="layui-form-item">
                            <div class="layui-input-block button">
                                <notempty name="op">
                                    <if condition="$flowType eq null">
                                        <a class="layui-btn btn-submit ajax-post" data-verify="all" data-url="{:U('form')}" data-form="">转交下一步</a>
                                    </if>
                                    <if condition="$prcs neq 1">
                                        <a class="layui-btn pointer back" data-verify="all" data-url="{:U('backFlow')}" data-form="" style="">回退</a>
                                    </if>
                                    <else />
                                    <a class="layui-btn pointer btn-submit ajax-post" data-verify="all" data-url="{:U('form',array('type'=>2))}" data-form="">办理完毕</a>
                                </notempty>
                                <a class="layui-btn pointer btn-submit ajax-post" data-verify="all" data-url="{:U('form',array('type'=>1))}" data-form="">保存</a>
                            </div>
                        </div>
                    </div>
                </form>

                <input type="hidden" id="url" value="{:U('getRunData',array('run_id'=>$run_id,'flow_id'=>$flow_id))}">
                <input type="hidden" id="feedbackUrl" value="{:U('getRunData',array('type'=>'feedback','run_id'=>$run_id))}">
                <input type="hidden" id="username" value="{$Think.session.user_name}">
                <input type="hidden" id="deparment" value="{$department}">
                <input type="hidden" id="formUrl" value="{:U('getFormData')}">
                <input type="hidden" id="FormAutoValueUrl" value="{:U('getFormAutoValue',array('flow_id'=>$flow_id))}"/>
                <if condition="$currPrcs eq 1">
                    <input type="hidden" id="FormNotNullFieldUrl" value="{:U('getFormNotNullField',array('flow_id'=>$flow_id,'form_id'=>$form_id))}">
                </if>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/flow.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(function () {
            $('.form input').val('');
//            $('.form table .text_value input,select').css({'width': '87%', 'padding': '0.3em'});
            $('.form table .text_value input,.text_td input').removeAttr('hidden')
            $('.form table .firstRow .text_td').removeAttr('colspan').removeAttr('rowspan');
        })
        $(initFormData());
        $(initFlowType());
        $(dateTime(1));
        $(initUpload("{:U(CONTROLLER_NAME.'/upload')}"));

    </script>  
</block>
